package eb;

public abstract class AgentInfo {

    public abstract void log(String lastNm, String firstNm, String code);

    protected static boolean isValidAgentName(String name) {
        boolean flag = true;
        char[] nameChars = name.toCharArray();

        for (char nameChar : nameChars) {
            if (!Character.isLetter(nameChar))
                flag = false;
        }
        return flag;
    }

    protected static boolean isValidCode(String code) {
        boolean flag = true;
        char[] codeChars = code.toCharArray();

        if (code.length() != 12) {
            flag = false;
        } else {
            for (char codeChar : codeChars) {
                if ((!Character.isLetter(codeChar)) && (!Character.isDigit(codeChar)))
                    flag = false;
            }
        }
        return flag;
    }
}
